FROM 192.168.10.79/chanpinzu/tomcat:8

ENV CATALINA_HOME /usr/local/tomcat
WORKDIR $CATALINA_HOME
ADD docker-start.sh bin
RUN cd bin && chmod 777 *.sh

ENV APP_BASE_URL="http://192.168.1.200:8081/repository/releases"
ENV APP_NAME=pmsuite-monitor-provider
ENV APP_VERSION=4.5
RUN mkdir -p webapps/ROOT && cd webapps/ROOT \
    && wget -q "$APP_BASE_URL/cn/pinming/$APP_NAME/$APP_VERSION/$APP_NAME-$APP_VERSION.war" \
    && unzip -q $APP_NAME-$APP_VERSION.war \
    && rm -rf $APP_NAME-$APP_VERSION.war

RUN mkdir -p /data/uploads

EXPOSE 8080
EXPOSE 20883
CMD ["docker-start.sh"]